<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AmpleHarvest: cTABLE_Data.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">AmpleHarvest
   &#160;<span id="projectnumber">0.0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('c_t_a_b_l_e___data_8php.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">cTABLE_Data.php</div>  </div>
</div>
<div class="contents">
<a href="c_t_a_b_l_e___data_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00005"></a>00005         use\ampleharvest\code;
<a name="l00006"></a>00006         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&#39;/config/cConfig.php&#39;</span>;
<a name="l00007"></a>00007         <span class="comment">//require_once dirname(dirname(dirname(__FILE__))) . &#39;/external/utf8.php&#39;;</span>
<a name="l00011"></a>00011 <span class="comment"></span>        require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/cTable.php&quot;</span>;
<a name="l00015"></a>00015         require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/ColTypes.php&quot;</span>;
<a name="l00016"></a>00016 
<a name="l00030"></a><a class="code" href="classc_t_a_b_l_e___data.html">00030</a>         <span class="keyword">class </span><a class="code" href="classc_t_a_b_l_e___data.html" title="Includes the base class for Tables (uses base path from the cinfo file.">cTABLE_Data</a> <span class="keyword">extends</span> cTable
<a name="l00031"></a>00031         {
<a name="l00036"></a><a class="code" href="classc_t_a_b_l_e___data.html#ac973438be7c79266212ec3b1285bbe98">00036</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#ac973438be7c79266212ec3b1285bbe98">C_INT_STATUS_INDEX_FAIL</a> = -2;
<a name="l00037"></a><a class="code" href="classc_t_a_b_l_e___data.html#afdab38de4827cff42fed85823e3659d3">00037</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#afdab38de4827cff42fed85823e3659d3">C_INT_STATUS_STAGE_1_FAIL</a> = -1;
<a name="l00038"></a><a class="code" href="classc_t_a_b_l_e___data.html#ac490efb1b4cba1b4fdcb905f4ea0d442">00038</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#ac490efb1b4cba1b4fdcb905f4ea0d442">C_INT_STATUS_NEW</a> = 0;
<a name="l00039"></a><a class="code" href="classc_t_a_b_l_e___data.html#acaf0b9006bad2ce6b15ca1e1a74b1e1c">00039</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#acaf0b9006bad2ce6b15ca1e1a74b1e1c">C_INT_STATUS_PROCESSING_DATA</a> = 1;
<a name="l00040"></a><a class="code" href="classc_t_a_b_l_e___data.html#a1d318dd9fffeeb44f21c1d900f0b8c51">00040</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#a1d318dd9fffeeb44f21c1d900f0b8c51">C_INT_STATUS_STAGE_1_SUCCESS</a> = 2;
<a name="l00041"></a><a class="code" href="classc_t_a_b_l_e___data.html#a52c2894c553570ba8bcbff5c4bcd8ee0">00041</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#a52c2894c553570ba8bcbff5c4bcd8ee0">C_INT_STATUS_INDEXING_DATA</a> = 3;
<a name="l00042"></a><a class="code" href="classc_t_a_b_l_e___data.html#a4e155facfa09d7bd0e17565c66afe47c">00042</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___data.html#a4e155facfa09d7bd0e17565c66afe47c">C_INT_STATUS_INDEX_SUCCESS</a> = 4;
<a name="l00051"></a><a class="code" href="classc_t_a_b_l_e___data.html#a514a7d018a27972078a89834ecfc19bb">00051</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a514a7d018a27972078a89834ecfc19bb">$m_int_COL_Category</a> = null;
<a name="l00052"></a><a class="code" href="classc_t_a_b_l_e___data.html#a91b0c7f6e27c01883c39b6f1b04472cc">00052</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a91b0c7f6e27c01883c39b6f1b04472cc">$m_int_COL_Data</a> = null;
<a name="l00053"></a><a class="code" href="classc_t_a_b_l_e___data.html#a73e829eb52396a471233937efc8233a8">00053</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a73e829eb52396a471233937efc8233a8">$m_int_COL_DataToken</a> = null;
<a name="l00054"></a><a class="code" href="classc_t_a_b_l_e___data.html#a8c8abc452bddb986f88f9e95e43a098d">00054</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a8c8abc452bddb986f88f9e95e43a098d">$m_int_COL_HarvestDate</a> = null;
<a name="l00055"></a><a class="code" href="classc_t_a_b_l_e___data.html#ad077898da1668be20c85ec881a673c2e">00055</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#ad077898da1668be20c85ec881a673c2e">$m_int_COL_ID</a> = null;
<a name="l00056"></a><a class="code" href="classc_t_a_b_l_e___data.html#a58d298f112ad0f25b14e94258e6b3441">00056</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a58d298f112ad0f25b14e94258e6b3441">$m_int_COL_IndexDate</a> = null;
<a name="l00057"></a><a class="code" href="classc_t_a_b_l_e___data.html#a8b16ef3965eb75ed77b8500882d65f15">00057</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a8b16ef3965eb75ed77b8500882d65f15">$m_int_COL_IndexToken</a> = null;
<a name="l00058"></a><a class="code" href="classc_t_a_b_l_e___data.html#a770754be38c6f3a920a79e9288483186">00058</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a770754be38c6f3a920a79e9288483186">$m_int_COL_OrigID</a> = null;
<a name="l00059"></a><a class="code" href="classc_t_a_b_l_e___data.html#a1c919338b77e6b4d218c913dbae75071">00059</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a1c919338b77e6b4d218c913dbae75071">$m_int_COL_Page</a> = null;
<a name="l00060"></a><a class="code" href="classc_t_a_b_l_e___data.html#a3a78744656bfe8b20f6500a0a3960edd">00060</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a3a78744656bfe8b20f6500a0a3960edd">$m_int_COL_ProcessToken</a> = null;
<a name="l00061"></a><a class="code" href="classc_t_a_b_l_e___data.html#a3438c7491aa8a88836cc9a602cff6c9d">00061</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a3438c7491aa8a88836cc9a602cff6c9d">$m_int_COL_PublishDate</a> = null;
<a name="l00062"></a><a class="code" href="classc_t_a_b_l_e___data.html#a058cfefdf06be2186dfb03f6284e381e">00062</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a058cfefdf06be2186dfb03f6284e381e">$m_int_COL_Source</a> = null;
<a name="l00063"></a><a class="code" href="classc_t_a_b_l_e___data.html#a23281ba5f596fe2a4ab8aa2710431706">00063</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___data.html#a23281ba5f596fe2a4ab8aa2710431706">$m_int_COL_Status</a> = null;
<a name="l00064"></a>00064 
<a name="l00072"></a><a class="code" href="classc_t_a_b_l_e___data.html#a095c5d389db211932136b53f25f39685">00072</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a095c5d389db211932136b53f25f39685" title="This constructor sets all the required column data.">__construct</a>()
<a name="l00073"></a>00073                 {
<a name="l00074"></a>00074                         $this-&gt;m_str_TableName = <span class="stringliteral">&quot;data&quot;</span>;
<a name="l00075"></a>00075                         $this-&gt;set_Engine(self::C_STR_ENGINE_INNODB);
<a name="l00076"></a>00076                         $this-&gt;set_CharSet(self::C_STR_CHAR_SET_BINARY);
<a name="l00077"></a>00077                         <span class="comment">//$this-&gt;set_Collation(self::C_STR_COLLATION_BINARY);</span>
<a name="l00078"></a>00078 
<a name="l00079"></a>00079                         <span class="comment">//Create Column Objects</span>
<a name="l00080"></a>00080                         $obj_COL_ID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;id&quot;</span>);
<a name="l00081"></a>00081                         $obj_COL_ID-&gt;set_Length(36);
<a name="l00082"></a>00082                         $obj_COL_ID-&gt;set_Index(abs_Column::c_int_INDEX_PRIMARY);
<a name="l00083"></a>00083                         $obj_COL_ID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the ID of the Data.&quot;</span>);
<a name="l00084"></a>00084                         $obj_COL_ID-&gt;set_Editable(<span class="keyword">false</span>);
<a name="l00085"></a>00085                         $obj_COL_ID-&gt;set_Label(<span class="stringliteral">&quot;ID&quot;</span>);
<a name="l00086"></a>00086 
<a name="l00087"></a>00087                         $obj_COL_Category = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;category&quot;</span>);
<a name="l00088"></a>00088                         $obj_COL_Category-&gt;set_Length(50);
<a name="l00089"></a>00089                         $obj_COL_Category-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00090"></a>00090                         $obj_COL_Category-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the category of the data.&quot;</span>);
<a name="l00091"></a>00091                         $obj_COL_Category-&gt;set_Label(<span class="stringliteral">&quot;Category&quot;</span>);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093                         $obj_COL_Data = <span class="keyword">new</span> cColLongBlob(<span class="stringliteral">&quot;data&quot;</span>);
<a name="l00094"></a>00094                         $obj_COL_Data-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the data.&quot;</span>);
<a name="l00095"></a>00095                         $obj_COL_Data-&gt;set_Label(<span class="stringliteral">&quot;Data&quot;</span>);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097                         $obj_COL_DataToken = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;dataToken&quot;</span>);
<a name="l00098"></a>00098                         $obj_COL_DataToken-&gt;set_Length(32);
<a name="l00099"></a>00099                         $obj_COL_DataToken-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00100"></a>00100                         $obj_COL_DataToken-&gt;set_Comment(<span class="stringliteral">&quot;This is the MD5 hash code of the last data update.&quot;</span>);
<a name="l00101"></a>00101                         $obj_COL_DataToken-&gt;set_Label(<span class="stringliteral">&quot;Data Token&quot;</span>);
<a name="l00102"></a>00102 
<a name="l00103"></a>00103                         $obj_COL_HarvestDate = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;harvest_date&quot;</span>);
<a name="l00104"></a>00104                         $obj_COL_HarvestDate-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00105"></a>00105                         $obj_COL_HarvestDate-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the date the data was harvested.&quot;</span>);
<a name="l00106"></a>00106                         $obj_COL_HarvestDate-&gt;set_Label(<span class="stringliteral">&quot;Harvest Date&quot;</span>);
<a name="l00107"></a>00107 
<a name="l00108"></a>00108                         $obj_COL_IndexDate = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;index_date&quot;</span>);
<a name="l00109"></a>00109                         $obj_COL_IndexDate-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the date the data was indexed.&quot;</span>);
<a name="l00110"></a>00110                         $obj_COL_IndexDate-&gt;set_Label(<span class="stringliteral">&quot;Index Date&quot;</span>);
<a name="l00111"></a>00111 
<a name="l00112"></a>00112                         $obj_COL_IndexToken = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;index_token&quot;</span>);
<a name="l00113"></a>00113                         $obj_COL_IndexToken-&gt;set_Length(32);
<a name="l00114"></a>00114                         $obj_COL_IndexToken-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00115"></a>00115                         $obj_COL_IndexToken-&gt;set_Comment(<span class="stringliteral">&quot;This is the value the data token was set to when the data was indexed.&quot;</span>);
<a name="l00116"></a>00116                         $obj_COL_IndexToken-&gt;set_Label(<span class="stringliteral">&quot;Index Token&quot;</span>);
<a name="l00117"></a>00117 
<a name="l00118"></a>00118                         $obj_COL_OrigID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;orig_id&quot;</span>);
<a name="l00119"></a>00119                         $obj_COL_OrigID-&gt;set_Length(100);
<a name="l00120"></a>00120                         $obj_COL_OrigID-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00121"></a>00121                         $obj_COL_OrigID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the id this data had from the original source.&quot;</span>);
<a name="l00122"></a>00122                         $obj_COL_OrigID-&gt;set_Label(<span class="stringliteral">&quot;Original ID&quot;</span>);
<a name="l00123"></a>00123 
<a name="l00124"></a>00124                         $obj_COL_Page = <span class="keyword">new</span> cColTinyInt(<span class="stringliteral">&quot;page&quot;</span>);
<a name="l00125"></a>00125                         $obj_COL_Page-&gt;set_Comment(<span class="stringliteral">&quot;This is the page number of the document.&quot;</span>);
<a name="l00126"></a>00126                         $obj_COL_Page-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00127"></a>00127                         $obj_COL_Page-&gt;set_Label(<span class="stringliteral">&quot;Page&quot;</span>);
<a name="l00128"></a>00128 
<a name="l00129"></a>00129                         $obj_COL_ProcessToken = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;processToken&quot;</span>);
<a name="l00130"></a>00130                         $obj_COL_ProcessToken-&gt;set_Length(32);
<a name="l00131"></a>00131                         $obj_COL_ProcessToken-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00132"></a>00132                         $obj_COL_ProcessToken-&gt;set_Comment(<span class="stringliteral">&quot;This is the value the data token was set to when the data was processed.&quot;</span>);
<a name="l00133"></a>00133                         $obj_COL_ProcessToken-&gt;set_Label(<span class="stringliteral">&quot;Data Token&quot;</span>);
<a name="l00134"></a>00134 
<a name="l00135"></a>00135                         $obj_COL_PublishDate = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;publish_date&quot;</span>);
<a name="l00136"></a>00136                         $obj_COL_PublishDate-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the date the data was published.&quot;</span>);
<a name="l00137"></a>00137                         $obj_COL_PublishDate-&gt;set_Label(<span class="stringliteral">&quot;Publish Date&quot;</span>);
<a name="l00138"></a>00138 
<a name="l00139"></a>00139                         $obj_COL_Source = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;source&quot;</span>);
<a name="l00140"></a>00140                         $obj_COL_Source-&gt;set_Length(200);
<a name="l00141"></a>00141                         $obj_COL_Source-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the source of the data.&quot;</span>);
<a name="l00142"></a>00142                         $obj_COL_Source-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00143"></a>00143                         $obj_COL_Source-&gt;set_Label(<span class="stringliteral">&quot;Source&quot;</span>);
<a name="l00144"></a>00144 
<a name="l00145"></a>00145                         $obj_COL_Status = <span class="keyword">new</span> cColTinyInt(<span class="stringliteral">&quot;status&quot;</span>);
<a name="l00146"></a>00146                         $obj_COL_Status-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the status of the data.&quot;</span>);
<a name="l00147"></a>00147                         $obj_COL_Status-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00148"></a>00148                         $obj_COL_Status-&gt;set_Label(<span class="stringliteral">&quot;Status&quot;</span>);
<a name="l00149"></a>00149 
<a name="l00150"></a>00150                         <span class="comment">//Set up connection</span>
<a name="l00151"></a>00151                         $this-&gt;m_obj_Connection = <span class="keyword">new</span> cConnection(<span class="stringliteral">&quot;AmpleHarvest&quot;</span>, <span class="stringliteral">&quot;admin&quot;</span>);
<a name="l00152"></a>00152 
<a name="l00153"></a>00153                         <span class="comment">//Activate all Debug options</span>
<a name="l00154"></a>00154                         $this-&gt;m_obj_Connection-&gt;set_DebugLevel(cLog_Connection_Debug::c_int_LEVEL_HIDDEN);
<a name="l00155"></a>00155                         $this-&gt;m_obj_Connection-&gt;set_LogLevel(cLog_Connection::c_int_LEVEL_BASIC);
<a name="l00156"></a>00156                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_Logging();</span>
<a name="l00157"></a>00157                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_LogDebug();</span>
<a name="l00158"></a>00158                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_ScreenDebug();</span>
<a name="l00159"></a>00159 
<a name="l00160"></a>00160                         $this-&gt;m_int_COL_ID = $this-&gt;add_Column($obj_COL_ID);
<a name="l00161"></a>00161                         $this-&gt;m_int_COL_Category = $this-&gt;add_Column($obj_COL_Category);
<a name="l00162"></a>00162                         $this-&gt;m_int_COL_Data = $this-&gt;add_Column($obj_COL_Data);
<a name="l00163"></a>00163                         $this-&gt;m_int_COL_DataToken = $this-&gt;add_Column($obj_COL_DataToken);
<a name="l00164"></a>00164                         $this-&gt;m_int_COL_HarvestDate = $this-&gt;add_Column($obj_COL_HarvestDate);
<a name="l00165"></a>00165                         $this-&gt;m_int_COL_IndexDate = $this-&gt;add_Column($obj_COL_IndexDate);
<a name="l00166"></a>00166                         $this-&gt;m_int_COL_IndexToken = $this-&gt;add_Column($obj_COL_IndexToken);
<a name="l00167"></a>00167                         $this-&gt;m_int_COL_OrigID = $this-&gt;add_Column($obj_COL_OrigID);
<a name="l00168"></a>00168                         $this-&gt;m_int_COL_Page = $this-&gt;add_Column($obj_COL_Page);
<a name="l00169"></a>00169                         $this-&gt;m_int_COL_ProcessToken = $this-&gt;add_Column($obj_COL_ProcessToken);
<a name="l00170"></a>00170                         $this-&gt;m_int_COL_PublishDate = $this-&gt;add_Column($obj_COL_PublishDate);
<a name="l00171"></a>00171                         $this-&gt;m_int_COL_Source = $this-&gt;add_Column($obj_COL_Source);
<a name="l00172"></a>00172                         $this-&gt;m_int_COL_Status = $this-&gt;add_Column($obj_COL_Status);
<a name="l00173"></a>00173                 }
<a name="l00174"></a>00174 
<a name="l00175"></a><a class="code" href="classc_t_a_b_l_e___data.html#a0001ac169d54c3f492f107fb76d678c2">00175</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a0001ac169d54c3f492f107fb76d678c2">insert_DefaultData</a>()
<a name="l00176"></a>00176                 {
<a name="l00177"></a>00177 
<a name="l00178"></a>00178                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00179"></a>00179                 }
<a name="l00180"></a>00180 
<a name="l00186"></a><a class="code" href="classc_t_a_b_l_e___data.html#acbb490790d87e7fdee9fc1d53354947b">00186</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00187"></a>00187                 {
<a name="l00188"></a>00188                         <span class="comment">// ensure that there is an ID passed and that it is a valid GUID</span>
<a name="l00189"></a>00189                         <span class="keywordflow">if</span> (!empty(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>) &amp;&amp; preg_match(self::c_REG_GUID_VALID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00190"></a>00190                         {
<a name="l00191"></a>00191                                 $this-&gt;clear_Query();
<a name="l00192"></a>00192                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00193"></a>00193                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00194"></a>00194                                 {
<a name="l00195"></a>00195                                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00196"></a>00196                                 }
<a name="l00197"></a>00197                         }
<a name="l00198"></a>00198                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00199"></a>00199                 }
<a name="l00200"></a>00200 
<a name="l00206"></a><a class="code" href="classc_t_a_b_l_e___data.html#a7f7d36d28f818d0d64ae30da6f170a0a">00206</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a7f7d36d28f818d0d64ae30da6f170a0a" title="Loads information into object from Database based on ID passed.">load_DataFromID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00207"></a>00207                 {
<a name="l00208"></a>00208                         $this-&gt;clear();
<a name="l00209"></a>00209 
<a name="l00210"></a>00210                         <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classc_t_a_b_l_e___data.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00211"></a>00211                         {
<a name="l00212"></a>00212                                 $this-&gt;clear_Query();
<a name="l00213"></a>00213                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00214"></a>00214                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00215"></a>00215                                 {
<a name="l00216"></a>00216                                         $obj_RS = $this-&gt;get_ResultSet();
<a name="l00217"></a>00217                                         <span class="keywordflow">if</span> ($obj_RS[0])
<a name="l00218"></a>00218                                         {
<a name="l00219"></a>00219                                                 $this-&gt;load_DataFromArray($obj_RS[0]);
<a name="l00220"></a>00220                                                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00221"></a>00221                                         }
<a name="l00222"></a>00222                                 }
<a name="l00223"></a>00223                         }
<a name="l00224"></a>00224                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00225"></a>00225                 }
<a name="l00226"></a>00226 
<a name="l00227"></a><a class="code" href="classc_t_a_b_l_e___data.html#a911a49525944199fe5f4cdbdc3d9e562">00227</a>                 <span class="keyword">static</span> <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a911a49525944199fe5f4cdbdc3d9e562">encode</a>($str_Data)
<a name="l00228"></a>00228                 {
<a name="l00229"></a>00229                         $str_Data = base64_encode(serialize($str_Data));
<a name="l00230"></a>00230                         <span class="keywordflow">return</span> $str_Data;
<a name="l00231"></a>00231                 }
<a name="l00232"></a>00232 
<a name="l00233"></a><a class="code" href="classc_t_a_b_l_e___data.html#a1255c78f6d7895ed7f454ff21c065118">00233</a>                 <span class="keyword">static</span> <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a1255c78f6d7895ed7f454ff21c065118">decode</a>($str_Data)
<a name="l00234"></a>00234                 {
<a name="l00235"></a>00235                         $str_Data = unserialize(base64_decode($str_Data));
<a name="l00236"></a>00236                         <span class="keywordflow">return</span> $str_Data;
<a name="l00237"></a>00237                 }
<a name="l00238"></a>00238 
<a name="l00242"></a><a class="code" href="classc_t_a_b_l_e___data.html#a42e7dcfc7851c0dedcafb63968ffbc02">00242</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a42e7dcfc7851c0dedcafb63968ffbc02" title="Saves Information to the Database.">save_Data2DB</a>()
<a name="l00243"></a>00243                 {
<a name="l00244"></a>00244                         <span class="keywordflow">if</span> ($this-&gt;get_data())
<a name="l00245"></a>00245                         {
<a name="l00246"></a>00246                                 $this-&gt;set_dataToken(md5($this-&gt;get_data()));
<a name="l00247"></a>00247                         }
<a name="l00248"></a>00248 
<a name="l00249"></a>00249                         <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classc_t_a_b_l_e___data.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>($this-&gt;get_id()))
<a name="l00250"></a>00250                         {
<a name="l00251"></a>00251                                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classc_t_a_b_l_e___data.html#a8bf8fc7182a41039d94dd975a0b40229" title="This function is used to update data that is already in the database.">update_Data2DB</a>();
<a name="l00252"></a>00252                         }
<a name="l00253"></a>00253                         <span class="keywordflow">else</span>
<a name="l00254"></a>00254                         {
<a name="l00255"></a>00255                                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classc_t_a_b_l_e___data.html#a2055504e90b0a396c1de85aaad0c80ab" title="This function is used to insert Data into the database.">insert_Data2DB</a>();
<a name="l00256"></a>00256                         }
<a name="l00257"></a>00257                 }
<a name="l00258"></a>00258                 <span class="comment">/*</span>
<a name="l00259"></a>00259 <span class="comment">                 public function get_data()</span>
<a name="l00260"></a>00260 <span class="comment">                 {</span>
<a name="l00261"></a>00261 <span class="comment">                 return utf8_decode($this-&gt;m_arr_Variables[&quot;data&quot;]);</span>
<a name="l00262"></a>00262 <span class="comment">                 }</span>
<a name="l00263"></a>00263 <span class="comment">                                                                                                                </span>
<a name="l00264"></a>00264 <span class="comment">                 public function set_data($str_Data)</span>
<a name="l00265"></a>00265 <span class="comment">                 {</span>
<a name="l00266"></a>00266 <span class="comment">                 $this-&gt;m_arr_Variables[&quot;data&quot;] = utf8_encode($str_Data);</span>
<a name="l00267"></a>00267 <span class="comment">                 }</span>
<a name="l00268"></a>00268 <span class="comment">                 */</span>
<a name="l00273"></a><a class="code" href="classc_t_a_b_l_e___data.html#a8bf8fc7182a41039d94dd975a0b40229">00273</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a8bf8fc7182a41039d94dd975a0b40229" title="This function is used to update data that is already in the database.">update_Data2DB</a>()
<a name="l00274"></a>00274                 {
<a name="l00275"></a>00275                         <span class="comment">//                      $this-&gt;clear_Update();</span>
<a name="l00276"></a>00276                         <span class="comment">//                      $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, $this-&gt;get_id());</span>
<a name="l00277"></a>00277 
<a name="l00278"></a>00278                         <span class="keywordflow">if</span> (!$this-&gt;validate_Update())
<a name="l00279"></a>00279                         {
<a name="l00280"></a>00280                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00281"></a>00281                         }
<a name="l00282"></a>00282                         <span class="keywordflow">foreach</span> ($this-&gt;m_arr_Variables as $key =&gt; $data)
<a name="l00283"></a>00283                         {
<a name="l00284"></a>00284                                 <span class="keywordflow">switch</span> ($key)
<a name="l00285"></a>00285                                 {
<a name="l00286"></a>00286 
<a name="l00287"></a>00287                                         <span class="keywordflow">case</span> $this-&gt;get_Column_Name($this-&gt;m_int_COL_Data):
<a name="l00288"></a>00288                                                 <span class="keywordflow">if</span> ($data)
<a name="l00289"></a>00289                                                 {
<a name="l00290"></a>00290                                                         $this-&gt;add_Update($key, $data);
<a name="l00291"></a>00291 
<a name="l00292"></a>00292                                                         <span class="comment">//$this-&gt;add_Update($key, &quot;0x&quot;.$this-&gt;strToHex($data),true);</span>
<a name="l00293"></a>00293                                                 }
<a name="l00294"></a>00294                                                 <span class="keywordflow">break</span>;
<a name="l00295"></a>00295 
<a name="l00296"></a>00296                                         <span class="keywordflow">default</span>:
<a name="l00297"></a>00297                                                 $this-&gt;add_Update($key, $data);
<a name="l00298"></a>00298                                 }
<a name="l00299"></a>00299                         }
<a name="l00300"></a>00300                         $int_Return = $this-&gt;do_Update();
<a name="l00301"></a>00301                         <span class="keywordflow">if</span> ($int_Return &lt; 0)
<a name="l00302"></a>00302                         {
<a name="l00303"></a>00303                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00304"></a>00304                         }
<a name="l00305"></a>00305                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00306"></a>00306                 }
<a name="l00307"></a>00307 
<a name="l00312"></a><a class="code" href="classc_t_a_b_l_e___data.html#a2055504e90b0a396c1de85aaad0c80ab">00312</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a2055504e90b0a396c1de85aaad0c80ab" title="This function is used to insert Data into the database.">insert_Data2DB</a>()
<a name="l00313"></a>00313                 {
<a name="l00314"></a>00314                         <span class="comment">//                      $this-&gt;set_id($this-&gt;create_GUID());</span>
<a name="l00315"></a>00315                         <span class="comment">//                      $this-&gt;set_date(date_format(new datetime(), &quot;Y-m-d H:i:s&quot;));</span>
<a name="l00316"></a>00316                         <span class="keywordflow">if</span> (!$this-&gt;validate_New())
<a name="l00317"></a>00317                         {
<a name="l00318"></a>00318                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00319"></a>00319                         }
<a name="l00320"></a>00320                         $this-&gt;clear_Insert();
<a name="l00321"></a>00321                         <span class="keywordflow">foreach</span> ($this-&gt;m_arr_Variables as $key =&gt; $data)
<a name="l00322"></a>00322                         {
<a name="l00323"></a>00323                                 <span class="keywordflow">switch</span> ($key)
<a name="l00324"></a>00324                                 {
<a name="l00325"></a>00325 
<a name="l00326"></a>00326                                         <span class="keywordflow">case</span> $this-&gt;get_Column_Name($this-&gt;m_int_COL_Data):
<a name="l00327"></a>00327                                                 <span class="keywordflow">if</span> ($data)
<a name="l00328"></a>00328                                                 {
<a name="l00329"></a>00329                                                         $this-&gt;add_Insert($key, $data);
<a name="l00330"></a>00330                                                         <span class="comment">//$this-&gt;add_Insert($key, &quot;0x&quot;.$this-&gt;strToHex($data),true);</span>
<a name="l00331"></a>00331                                                 }
<a name="l00332"></a>00332                                                 <span class="keywordflow">break</span>;
<a name="l00333"></a>00333 
<a name="l00334"></a>00334                                         <span class="keywordflow">default</span>:
<a name="l00335"></a>00335                                                 $this-&gt;add_Insert($key, $data);
<a name="l00336"></a>00336                                 }
<a name="l00337"></a>00337                         }
<a name="l00338"></a>00338                         $int_Return = $this-&gt;do_Insert();
<a name="l00339"></a>00339                         <span class="keywordflow">if</span> ($int_Return &lt; 0)
<a name="l00340"></a>00340                         {
<a name="l00341"></a>00341                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00342"></a>00342                         }
<a name="l00343"></a>00343                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00344"></a>00344                 }
<a name="l00345"></a>00345 
<a name="l00346"></a><a class="code" href="classc_t_a_b_l_e___data.html#a66c875dda2e13de897bbb5a2d84398ce">00346</a>                 <span class="keyword">private</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___data.html#a66c875dda2e13de897bbb5a2d84398ce">strToHex</a>($string)
<a name="l00347"></a>00347                 {
<a name="l00348"></a>00348                         <span class="comment">//$arr_UTF8 = utf8ToUnicode($string);</span>
<a name="l00349"></a>00349                         $hex = <span class="stringliteral">&#39;&#39;</span>;
<a name="l00350"></a>00350                         <span class="comment">//foreach($arr_UTF8 as $int_Code)</span>
<a name="l00351"></a>00351                         <span class="comment">//{</span>
<a name="l00352"></a>00352                         <span class="comment">//      $hex .= dechex($int_Code);</span>
<a name="l00353"></a>00353                         <span class="comment">//}</span>
<a name="l00354"></a>00354 
<a name="l00355"></a>00355                         <span class="keywordflow">for</span> ($i = 0; $i &lt; strlen($string); $i++)
<a name="l00356"></a>00356                         {
<a name="l00357"></a>00357                                 $hex .= dechex(ord($string[$i]));
<a name="l00358"></a>00358                         }
<a name="l00359"></a>00359 
<a name="l00360"></a>00360                         <span class="keywordflow">return</span> $hex;
<a name="l00361"></a>00361                 }
<a name="l00362"></a>00362 
<a name="l00363"></a>00363         }
<a name="l00364"></a>00364 ?&gt;
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="c_t_a_b_l_e___data_8php.html">cTABLE_Data.php</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Mon Jan 23 2012 13:34:20 for AmpleHarvest by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
